<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" />
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
    <title>商品收藏</title>
    <meta name="keywords" content="关键词,5个左右,单个8汉字以内">
    <meta name="description" content="网站描述，字数尽量空制在80个汉字，160个字符以内！">
    <link rel="Bookmark" href="favicon.ico">

    <link href="../css/reset.css" rel="stylesheet" type="text/css" />
    <link href="../css/style.css" rel="stylesheet" type="text/css" />
</head>

<body>

<#include "../common/personnavigation.ftl" />
<#include "../common/header.ftl" />

<@personheader></@personheader>

<div class="container cf accortop">

    <!--导航-->
    <@personnavigation></@personnavigation>
    <input type="hidden" id="hfGoodId" value="">
    <!---->
    <div class="orderlist">
        <h1>商品收藏</h1>
        <section class="cartMain">
            <div class="cartMain_hd">
                <ul class="order_lists cartTop">
                    <li class="list_chk">
                        <input type="checkbox" id="all" class="whole_check">
                        <label for="all"></label> 全选
                    </li>
                    <li class="list_info w150">商品编号</li>
                    <li class="list_con w400">商品名称</li>
                    <li class="list_price w200">单价(元)</li>
                    <li class="list_op">操作</li>
                </ul>
            </div>
            <div class="cartBox">
                <div class="order_content">
                    <#if favoritesGoods??>
                    <#list favoritesGoods as goods>
                        <ul class="order_lists">
                            <li class="list_chk">
                                <input type="checkbox" id="checkbox_8" class="son_check">
                                <label for="checkbox_8"></label>
                            </li>
                            <li class="list_info w150">${goods.taobaoGoodId?long?c}</li>
                            <li class="list_con w400">
                                <div class="list_img">
                                    <a href="javascript:;"><img src="${goods.smallPicture}" alt=""></a>
                                </div>
                                <div class="list_text">
                                    <a href="javascript:;">${goods.title}</a>
                                </div>
                            </li>
                            <li class="list_price w200">
                                <p class="price">￥${goods.taobaoPrice/100}</p>
                            </li>
                            <li class="list_op">
                                <p class="del">
                                    <a href="javascript:;" class="delBtn" onclick="getGoodId(${goods.hfGoodId?long?c})">移除商品</a>
                                </p>
                            </li>
                        </ul>
                    </#list>
                    </#if>
                </div>
            </div>
        </section>
        <!--分页-->
        <div class="fye">
            <ul class="pagination" id="page1">
                <li>
                    <a aria-label="Previous">«</a>
                </li>
                <li>
                    <a>上一页</a>
                </li>
                <li class="active">
                    <a>1</a>
                </li>
                <li>
                    <a>2</a>
                </li>
                <li>
                    <a>3</a>
                </li>
                <li>
                    <a>下一页</a>
                </li>
                <li>
                    <a aria-label="Next">»</a>
                </li>
            </ul>
            <div class="pageJump">
                <span>跳转到</span>
                <input type="text">
                <span>页</span>
                <button type="button" class="button">确定</button>
            </div>
        </div>

        <section class="model_bg"></section>
        <section class="my_model">
            <p class="title">删除宝贝
                <!--<span class="closeModel">X</span>--></p>
            <p>您确认要删除该宝贝吗？</p>
            <div class="opBtn">
                <a href="javascript:;" class="dialog-sure" onclick="removeGood()">确定</a>
                <a href="javascript:;" class="dialog-close">关闭</a>
            </div>
        </section>

    </div>
</div>

<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript" src="../js/carts.js"></script>
<script>
    $(function() {
        // nav收缩展开
        $('.navMenu li a').on('click', function() {
            var parent = $(this).parent().parent(); //获取当前页签的父级的父级
            var labeul = $(this).parent("li").find(">ul")
            if($(this).parent().hasClass('open') == false) {
                //展开未展开
                parent.find('ul').slideUp(300);
                parent.find("li").removeClass("open")
                parent.find('li a').removeClass("active").find(".icon-under").removeClass("open")
                $(this).parent("li").addClass("open").find(labeul).slideDown(300);
                $(this).addClass("active").find(".icon-under").addClass("open")
            } else {
                $(this).parent("li").removeClass("open").find(labeul).slideUp(300);
                if($(this).parent().find("ul").length > 0) {
                    $(this).removeClass("active").find(".icon-under").removeClass("open")
                } else {
                    $(this).addClass("active")
                }
            }

        });
    });
    
    function getGoodId(elval) {
        $('#hfGoodId').val(elval)
    }
    function removeGood() {
        var hfGoodId =$('#hfGoodId').val();
        $.ajax({
            url:"/user/delFavoriteGoods",
            data:{"hfGoodId":hfGoodId},
            type:"post",
            success:function (data) {
                var dataObj = JSON.parse(data);
                if(dataObj.result.resultCode==8888){
                  //  window.alert("收藏成功!");
                }else{
                    alert("删除收藏失败！");
                }
            }
        })
    }
</script>
</body>

</html>